package edu.ccut.titan.tag.report.chart.dataset;

import net.sf.jasperreports.charts.design.JRDesignTimePeriodDataset;
import net.sf.jasperreports.charts.design.JRDesignTimePeriodSeries;
import net.sf.jasperreports.engine.JRChartDataset;
import net.sf.jasperreports.engine.JRExpression;
import net.sf.jasperreports.engine.design.JRDesignExpression;
import edu.ccut.titan.tag.report.design.ChartsInfo;

public class TitanTimePeriodDataset implements ITitanDataset {

	public JRChartDataset getDatasetContent(ChartsInfo chart) {
		JRDesignTimePeriodDataset designTimePeriodDataset = new JRDesignTimePeriodDataset(
				null);
		JRDesignTimePeriodSeries timePeriodSeries = new JRDesignTimePeriodSeries();
		JRDesignExpression seriesExpression = new JRDesignExpression();
		timePeriodSeries.setSeriesExpression(seriesExpression);
		JRDesignExpression startDateExpression = new JRDesignExpression();
		timePeriodSeries.setStartDateExpression(startDateExpression);
		JRDesignExpression endDateExpression = new JRDesignExpression();
		timePeriodSeries.setEndDateExpression(endDateExpression);
		JRExpression valueExpression = new JRDesignExpression();
		timePeriodSeries.setValueExpression(valueExpression);
		designTimePeriodDataset.addTimePeriodSeries(timePeriodSeries);
		return designTimePeriodDataset;
	}

}
